{% load i18n %}
<h2>Blogroll</h2>
{% for feed in blogroll %}
<h3>{{ feed.feed.title }} <a href="{{ feed.feed.link }}" style="font-size:80%" target="_blank">link</a></h3>
<dl class="blogroll-entrylist">
{% for entry in feed.entries|slice:':5' %}
<dt class="blogroll-entry" id="entry-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0 }}">&rsaquo; 
<a href="{{ entry.link }}" target="_blank">{{ entry.title }}</a> &rsaquo;
<a href="javascript:" id="trigger-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0 }}" style="font-size: 80%;">Preview</a>
<script type="text/javascript">
$("#trigger-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0}}").click(function() {
  if ( $("#trigger-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0}}").html() == 'Preview' ) {
    $("#teaser-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0 }}").css('display', 'inherit');
    $("#trigger-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0}}").html('Hide');
  } else {
    $("#teaser-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0 }}").css('display', 'none');
    $("#trigger-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0}}").html('Preview');
  };
});
$(document).ready(function() {$("#teaser-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0 }}").css('display', 'none');});
</script>
</dt>
<dd class="blogroll-teaser" id="teaser-b{{ forloop.parentloop.counter0 }}e{{ forloop.counter0 }}">{% with entry.content.0.value|striptags|truncatewords:50 as content %}{% if content %}{{ content|safe }}{% else %}<em>{% trans "No preview available" %}</em>{% endif %}{% endwith %}</dd>
{% endfor %}
</dl>
{% empty %}
<p><em>{% trans "No blogs in the blog roll" %}</em></p>
{% endfor %}